package com.aq.front.action;

import org.apache.commons.lang.StringUtils;

import com.aq.front.service.IFrontService;
import com.aq.model.AqCase;
import com.aq.model.AqMessage;
import com.aq.model.AqMessageBack;
import com.aq.model.AqNews;
import com.aq.model.AqProduct;
import com.aq.model.AqSolvtion;
import com.hs.core.action.AbstractAction;

public class ViewAction extends AbstractAction {
	

	private static final long serialVersionUID = 1L;
	
	private IFrontService frontService;  
	
	private AqNews aqNews ;
	private AqCase aqCase;
	private AqProduct aqProduct;
	private AqSolvtion aqSolvtion;
	private AqMessage aqMessage;
	private AqMessageBack aqMessageBack;
	
	private String id;
	private String type;
	
	
	
	public String viewNews(){
		
    	if(StringUtils.isNotEmpty(getId())){
    		this.aqNews = (AqNews)frontService.findByID(AqNews.class,new Long(this.getId()));
    	} 
		return SUCCESS;
	}
	
   public String viewCase(){
		
    	if(StringUtils.isNotEmpty(getId())){
    		this.aqCase = (AqCase)frontService.findByID(AqCase.class,new Long(this.getId()));
    	} 
		return SUCCESS;
	}

	/**
	 * @return the frontService
	 */
	public IFrontService getFrontService() {
		return frontService;
	}

	/**
	 * @param frontService the frontService to set
	 */
	public void setFrontService(IFrontService frontService) {
		this.frontService = frontService;
	}

	public AqCase getAqCase() {
		return aqCase;
	}

	public void setAqCase(AqCase aqCase) {
		this.aqCase = aqCase;
	}

	public AqMessage getAqMessage() {
		return aqMessage;
	}

	public void setAqMessage(AqMessage aqMessage) {
		this.aqMessage = aqMessage;
	}

	public AqMessageBack getAqMessageBack() {
		return aqMessageBack;
	}

	public void setAqMessageBack(AqMessageBack aqMessageBack) {
		this.aqMessageBack = aqMessageBack;
	}

	public AqNews getAqNews() {
		return aqNews;
	}

	public void setAqNews(AqNews aqNews) {
		this.aqNews = aqNews;
	}

	public AqProduct getAqProduct() {
		return aqProduct;
	}

	public void setAqProduct(AqProduct aqProduct) {
		this.aqProduct = aqProduct;
	}

	public AqSolvtion getAqSolvtion() {
		return aqSolvtion;
	}

	public void setAqSolvtion(AqSolvtion aqSolvtion) {
		this.aqSolvtion = aqSolvtion;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}
         
}
